The Crimson series supports two VME busses, numbered 0 and 1.
Challenge and Onyx systems support as many as five VME buses. The first is number 0. Use the hinv command to display the numbers of others (and see "VME Bus Numbering").
This will be either A16, A24, or A32--the A64 space is not supported for PIO.
This must be a sequential range of VME bus addresses that spans all the device registers you need to map.
bustype | Specified as VME for VME devices. The VECTOR statement can be used for other types of buses as well. |
adapter | The number of the VME bus where the device is attached. |
iospace, iospace2, iospace3 | Each iospace group specifies the VME address space and modifier, the starting bus address, and the size of a segment of VME address space used by this device. |
Within each iospace parameter group you find keywords and numbers for the address space, modifier, and addresses for a device. The following is an example of a VECTOR line:
This example specifies a VME device (bustype=VME) on bus 0 (adapter=0). The device resides in the A24 address space in supervisory mode (iospace=(A24S...)). Its first VME bus address is 0xF0 0000 and it covers a span of 0x01 0000 (64K) addresses--in other words, 0xF0 0000 through 0xF0 FFFF.VECTOR: bustype=VME module=cdsio ipl=5 ctlr=0 adapter=0 iospace=(A24S,0xF00000,0x10000) probe_space=(A24S,0xF0FFFF,1)
For third-party VME devices, look for a VECTOR line supplied by the manufacturer, usually stored in some file in /var/sysgen/system.
The naming convention for these files is documented in the usrvme(7) reference page. Briefly, each file is named vmeBaSM, where
B | is one or two digits for the bus number, for example 0 or 53 |
S | is two digits for the address space, 16, 24, or 32 |
M | is the modifier, either s for supervisory or n for nonprivileged |
The device special file for the device described by the example VECTOR line in the preceding section would be /dev/vme/vme0a24s.
In order to map a device on a particular bus and address space, you must open the corresponding file in /dev/vme.
This function is documented for all its many uses in the mmap(2) reference page. For purposes of mapping a VME device into memory, the parameters should be as follows (using the names from the reference page):
addr | Should be NULL to permit the kernel to choose an address in user process space. |
len | The length of the span of VME addresses, as documented in the iospace group in the VECTOR line. |
prot | PROT_READ for input, PROT_WRITE for output, or the logical sum of those names when the device will be used for both input and output. |
flags | MAP_SHARED, with the addition of MAP_PRIVATE if this mapping is not to be visible to child processes created with the sproc() function (see the sproc(2) reference page). |
fd | The file descriptor returned from opening the device special file in /dev/vme. |
off | The starting VME bus address, as documented in the iospace group in the VECTOR line. |
The value returned by mmap() is the virtual address that corresponds to the starting VME bus address. When the process accesses that address, the access is implemented by data transfer to the VME bus.
In all systems that support the VME bus it is possible to map all of A16 space.
In a Silicon Graphics Crimson system, the upper 8 MB of A24 space, from 0x80 0000 to 0xFF FFFF can be mapped. Only a fixed part of the A32 space can be mapped. A total of 256 MB of addresses is divided between the supervisor and nonprivileged A32 spaces on one or two VME buses. For details of the VME bus addresses, see "Crimson Mapping of A32 Space". VME devices that respond to addresses in the ranges shown in that section can be mapped for PIO.
In the Silicon Graphics Challenge and Onyx systems, all of A24 and A32 space can be used for PIO mappings, but there is a limit on the size of each map. Each bus mapping uses a hardware register that can span as much as 8 MB of contiguous VME bus addresses--so a single mmap() call can map at most 8 MB. There are as many as 12 mapping registers for each bus, so by making successive mmap() calls for adjacent 8 MB blocks of VME space you can map up to 96 MB of VME space into user process space from a single bus.